﻿@model IEnumerable<Modelo.Transportadora>

@{
    ViewBag.Title = "Transportadora";
}

<h2>Index</h2>




@{


  Html.Telerik().Grid(Model)

            .Name("Transportadora")
            .ToolBar(commands => commands.Insert())
            .DataKeys(dataKeys => dataKeys.Add(model => model.Id))
            .DataBinding (dataBinding => dataBinding
                //Server binding
                .Server()
                /*Server binding
                    .Server()
                //Home.Update updates an existing data record*/
                //.Select("Index", "TranportadoraController")
                .Insert("Create", "Tranportadora")
                .Update("Edit", "Tranportadora")
                .Delete("Delete", "Tranportadora")
            )
            .Columns(columns =>
            {
                columns.Bound(model => model.Id).ReadOnly().Width(50);
                columns.Bound(model => model.Nome).Width(250);
                columns.Bound(model => model.CNPJ).Width(250);
                columns.Bound(model => model.Endereco).Width(250);
                columns.Bound(model => model.EmailResponsavel).Width(250);
                columns.Command(commands => commands.Edit()).Width(100);
                columns.Command(commands => commands.Delete()).Width(100);
            }
            )
            .Pageable()
            .Sortable().Render();
        
    }




